package com.xiumu.common.minio;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
@EnableConfigurationProperties(MinioProperties.class)
public class MinioConfiguration {

    @Bean
    public MinioTemplate minioTemplate(MinioProperties properties) {
        log.info("自定义配置：minio, host={}, defaultBucket={}", properties.getHost(), properties.getDefaultBucketName());
        return new MinioTemplate(properties);
    }

}
